var curData;
var DEFAULT_IMG = '';			//这里设置默认图片
var dataList ;
var curItemId = 0;
$(function(){
	if(_isAli){
		IMPlayer.CheckConnection ();
		IMPlayer.UpdateStatusSignal.connect(OnStateChanged);
	}
	window.addEventListener("pagehide", pageHide, false);
	
	curData = {
		id:1,
		title:'Youtube 播放1',	
		img:'',	
		url:'#',			//youtube对应的页面地址
	}
	
	playVod(curData);
	
	loadRelateList(curData,afterLoadList);
});

function pageHide(){
	IMPlayer.Stop();
}


function playVod(data){
	if(data.playUrl){
		play(data);
	}else{
		showGPointLoading(550,285);
		KEY.PRESS = false;
		loadPlayURL(data,afterLoadData);
	}
}

function afterLoadData(data,playUrl){ 
	hideGPointLoading();
	KEY.PRESS = true;
	
	data.playUrl = playUrl;
	play(data);
}

function afterLoadList(data,list){
	dataList = list;
}
